package com.gin.kotlin.no_gay_alliance.model

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.gin.kotlin.no_gay_alliance.database.entity.BanKeyword
import com.gin.kotlin.no_gay_alliance.database.entity.BanUser
import java.time.ZonedDateTime

/**
 * 脚本"NGA优化摸鱼体验"使用的导入导出配置
 * @property name String
 * @property ver String
 * @property timestamp ZonedDateTime
 * @property banKeywords List<String>?
 * @property banUsers List<BanUser>?
 * @constructor
 */
class MoyuConfigModel {
    var name: String = "NGA-BBS-SCRIPT"
    var ver: String = "4.5.2"
    var timestamp: ZonedDateTime = ZonedDateTime.now()

    @JsonProperty("keywords_list")
    var banKeywords: List<String>? = null

    @JsonProperty("ban_list")
    var banUsers: List<BanUser>? = null

    @JsonCreator
    constructor()

    constructor(banUsers: List<BanUser>? = null, banKeywords: List<BanKeyword>? = null) {
        this.banKeywords = banKeywords?.map { it.value }
        this.banUsers = banUsers
    }
}
